import Vue from 'vue'
import App from './App.vue'
import router from './router'
// element
import {
    Pagination,
    Loading,
    MessageBox,
    Notification,
    Message,
    Form,
    Table,
    TableColumn,
    FormItem,
    Breadcrumb,
    BreadcrumbItem,
    Button,
    Input,
    Checkbox,
    Image,
    Radio,
    RadioGroup,
    Upload,
    CheckboxGroup,
    Dialog,
    Dropdown,
    DropdownItem,
    DropdownMenu,
    Popover,
    Card,
    Collapse,
    CollapseItem,
    Divider
} from 'element-ui';

// 按需引入element
Vue.use(Button);
Vue.use(Breadcrumb);
Vue.use(BreadcrumbItem);
Vue.use(Form);
Vue.use(FormItem);
Vue.use(Pagination);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(Input);
Vue.use(Checkbox);
Vue.use(Image);
Vue.use(Radio);
Vue.use(Dialog);
Vue.use(RadioGroup);
Vue.use(Upload);
Vue.use(CheckboxGroup);
Vue.use(Dropdown);
Vue.use(DropdownItem);
Vue.use(DropdownMenu);
Vue.use(Popover);
Vue.use(Card);
Vue.use(Collapse);
Vue.use(CollapseItem);
Vue.use(Divider);
Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$notify = Notification;
Vue.prototype.$message = Message;
import 'element-ui/lib/theme-chalk/index.css';
// layui
import 'layui-layer'
// Clipboard
// import Clipboard from 'clipboard';  
// Vue.prototype.Clipboard=Clipboard;
import './static/font-awesome/css/font-awesome.min.css'

import Cookies from 'js-cookie'

// Validator.updateDictionary(dictionary);


Vue.prototype.thisEditorObj = {},//定义一个全局的变量在编辑器中引用
    Vue.config.productionTip = false
import {post, get, patch,Delete} from './utils/http'
//定义全局变量
Vue.prototype.$post = post;
Vue.prototype.$get = get;
Vue.prototype.$patch = patch;
Vue.prototype.$Delete  = Delete;

router.afterEach( ( to, from, next ) => {
    setTimeout(()=>{
        var _hmt = _hmt || [];
        (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?1091a72967336bce4d365be4c58df9ab";
        var s = document.getElementsByTagName("script")[0]; 
        s.parentNode.insertBefore(hm, s);
        })();
    },0);
} );

new Vue({
    router,
    render: h => h(App)
}).$mount('#app')
